This section describes the functions you can use to track the cursor while the user resizes a window and to draw the window in a new size.
Allows the user to change the size of a window.
pascal long GrowWindow (WindowPtr theWindow,
Point startPt,
const Rect *bBox);
The GrowWindow function displays an outline (grow image) of the window as the user moves the cursor to make the window larger or smaller; it handles all user interaction until the user releases the mouse button. After calling GrowWindow , you call the SizeWindow function (SizeWindow) to change the size of the window.
The GrowWindow function moves a dotted-line image of the window's right and lower edges around the screen, following the movements of the cursor until the mouse button is released. It returns the new dimensions, in pixels, of the resulting window: the height in the high-order word of the returned long-integer value and the width in the low-order word. You can use the functions HiWord and LoWord (described in Inside Macintosh: Operating System Utilities ) to retrieve only the high-order and low-order words, respectively.
A return value of 0 means that the new size is the same as the size of the current port rectangle.
You can set the global variable DragHook to point to an optional function, defined by your application, which will be called by GrowWindow as long as the mouse button is held down. (If there's an actionProc function, the actionProc function is called first.) Note that the use of the Window Manager's global variables is not guaranteed to be compatible with system software versions later than System 6.
pascal void SizeWindow (WindowPtr theWindow,
short w,
short h,
Boolean fUpdate);
The SizeWindow function changes the size of the window's graphics port rectangle to the dimensions specified by the w and h parameters, or does nothing if the values of w and h are 0. The Window Manager redraws the window in the new size, recentering the title and truncating it if necessary. Your application calls SizeWindow immediately after calling GrowWindow (GrowWindow) to adjust the window to any changes made by the user through the size box.